# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit mono multilib subversion

ESVN_REPO_URI="svn://anonsvn.mono-project.com/source/trunk/tao/src"
ESVN_PROJECT="tao"
EXT="Tao.OpenGl"

#SRC_URI="http://belnet.dl.sourceforge.net/sourceforge/taoframework/${P}.tar.gz"

DESCRIPTION="TAO OpenGl Framework for C#" 
HOMEPAGE="www.mono-project.com/Tao"

LICENSE="GPL-2"
SLOT="2"
KEYWORDS="~amd64"
IUSE="doc"

RDEPEND=">=dev-lang/mono-1.0"
DEPEND="${RDEPEND}
		=dev-dotnet/prebuild-9999
		doc? ( >=dev-util/monodoc-1.0 )
		>=dev-util/pkgconfig-0.19"

MAKEOPTS="${MAKEOPTS} -j1"

src_unpack() {
	subversion_src_unpack
}

src_compile() {
	cd "${S}/${EXT}"

	einfo "Using prebuild to create autoconf tools build ..."
	prebuild /target autotools || die "prebuild failed."

	export GACUTIL_FLAGS="-root ${D}/usr/$(get_libdir) -gacdir /usr/$(get_libdir) -package ${PN}-${SLOT}"


	cd ${S}/${EXT}/autotools/${EXT}

	epatch "${FILESDIR}/tao-remove-extra.patch"
	sh autogen.sh

	econf || die "configure failed"
	emake || die "make failed"
}

src_install() {
	cd ${S}/${EXT}/autotools/${EXT}
	make DESTDIR="${D}" install || die "install failed"
}
